package online.afeibaili.storebackendframework.configuration

import online.afeibaili.storebackendframework.util.IMAGES_PATH
import online.afeibaili.storebackendframework.util.VIDEO_PATH
import org.springframework.context.annotation.Configuration
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer


/**
 * 网络配置类
 *
 *@author AfeiBaili
 *@version 2025/10/19 17:16
 */

@Configuration
class WebConfig : WebMvcConfigurer {
    override fun addResourceHandlers(registry: ResourceHandlerRegistry) {
        registry.addResourceHandler("/image/**")
            .addResourceLocations("file:$IMAGES_PATH")

        registry.addResourceHandler("/video/**")
            .addResourceLocations("file:$VIDEO_PATH")
    }
}